package org.com.myfb.action;

import java.util.List;

import org.com.myfb.dao.PersonDaoInter;
import org.com.myfb.dao.StudentsDaoInter;
import org.com.myfb.model.Person;
import org.com.myfb.model.Students;
import org.com.myfb.service.PersonServiceInter;

import com.opensymphony.xwork2.ActionSupport;

public class DeleteStudentAction extends ActionSupport{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private PersonDaoInter personDaoImpl;
	private int sid;
	private PersonServiceInter personServiceImpl;
	private StudentsDaoInter studentsDaoImpl;
	
	
	public StudentsDaoInter getStudentsDaoImpl() {
		return studentsDaoImpl;
	}
	public void setStudentsDaoImpl(StudentsDaoInter studentsDaoImpl) {
		this.studentsDaoImpl = studentsDaoImpl;
	}
	public PersonDaoInter getPersonDaoImpl() {
		return personDaoImpl;
	}
	public void setPersonDaoImpl(PersonDaoInter personDaoImpl) {
		this.personDaoImpl = personDaoImpl;
	}
	public int getSid() {
		return sid;
	}
	public void setSid(int sid) {
		this.sid = sid;
	}
	public PersonServiceInter getPersonServiceImpl() {
		return personServiceImpl;
	}
	public void setPersonServiceImpl(PersonServiceInter personServiceImpl) {
		this.personServiceImpl = personServiceImpl;
	}
	
	public String execute(){
		
		System.out.println("删除学生的*******5");
		sid=this.getSid();
		Students student = new Students();
		System.out.println(sid);
		student = this.getStudentsDaoImpl().get(Students.class, sid);
		
		System.out.println("添删除学生的*******6");
		this.getPersonServiceImpl().deleteStudents(student);
		System.out.println("添删除学生的*******6");
		return SUCCESS;
	}
	
}
